﻿@{
    ViewBag.Title = "评论管理";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

@model List<UcAsp.Net.Model.Comments>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="widget-box">
            <div class="widget-title">
                <span class="icon"><i class="icon-th"></i></span>
                <h5>
                    类目管理</h5>
            </div>
            <div class="widget-content nopadding">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>
                                提问标题
                            </th>
                            <th>
                                相关标题
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (UcAsp.Net.Model.Comments v in Model)
                        {
                            <tr>
                                <td>@v.Title 
                                </td>
                                <td>
                                      @v.Articles.Title 
                                </td>
                                <td>
                                    <span class="btn" data-id="@v.ID">显示</span><span class="btn" data-id="@v.ID">关闭</span>
                                </td>
                            </tr>
                            <tr id="@v.ID" style="display:none">
                            <td colspan="3">&nbsp;</td>
                            </tr>
                        }
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="3">
                                <div class="btn-group">
                                    <a class="btn" href="/admin/command?PageIndex=1">
                                        <i class="icon-step-backward"></i>
                                    </a>
                                    <a class="btn" href="/admin/command?PageIndex=@ViewData["Pre"]">
                                        <i class="icon-backward"></i>
                                    </a>
                                    @for (int i = 1; i < int.Parse(ViewData["PageCount"].ToString())+1; i++)
                                    { 
                                    <a class="btn" href="/admin/command?PageIndex=@i">
                                        @i.ToString()
                                    </a>
                                    }
                                   
                                    
                                    <a class="btn" href="/admin/command?PageIndex=@ViewData["Next"]">
                                        <i class="icon-forward"></i>
                                    </a>
                                    <a class="btn" href="/admin/command?PageIndex=@ViewData["PageCount"]">
                                        <i class="icon-step-forward"></i>
                                    </a>
                                </div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
</div>

  <script>
      $(document).ready(function () {
          $(".btn").click(function () {
              alert($(this).attr("data-id"));
          })
      })
    </script>